﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="OrderManager.Web.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style>
        .tableCustomer
        {
            width: 400px;
            border-style: solid;
            border-width: 1px;
        }

            .tableCustomer tr td
            {
                border-style: solid;
                border-width: 1px;
                border-spacing: 0;
            }

        .tableOrders
        {
            width: 600px;
            border-style: solid;
            border-width: 1px;
        }

            .tableOrders tr td
            {
                border-style: solid;
                border-width: 1px;
            }

        .tableHeader
        {
            font-size: large;
            text-align: center;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table>
                <tr class="tableHeader">
                    <td>Customer data</td>
                    <td>Orders data</td>
                </tr>
                <tr valign="top">
                    <td>
                        <table id="cTblCustomers" class="tableCustomer">
                            <tr align="center">
                                <td style="width: 80px">Customer</td>
                                <td>Address</td>
                                <td style="width: 60px">Action</td>
                            </tr>
                            <asp:Repeater ID="cRptCustomers" runat="server" OnItemDataBound="OnCustomerItemBound">
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:HiddenField ID="cCustomerId" runat="server" />
                                            <asp:LinkButton ID="cLnkCustomerName" runat="server" OnCommand="OnCustomerSelect" />
                                        </td>
                                        <td>
                                            <asp:Label ID="cLblCustomerAddress" runat="server" />
                                        </td>
                                        <td align="center">
                                            
                                            <%--<asp:LinkButton ID="cBtnEditCustomer" runat="server" OnCommand="OnEditCustomer" />--%>
                                            <asp:LinkButton ID="cBtnDeleteCustomer" runat="server" OnCommand="OnDeleteCustomer" />
                                           
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </table>
                    </td>
                    <td style="width: 60%">
                        <table id="cTblOrders" class="tableOrders">
                            <tr align="center">
                                <td style="width: 50px">Number</td>
                                <td style="width: 80px">Date</td>
                                <td style="width: 80px">Amount</td>
                                <td>Description</td>
                                <td style="width: 60px">Action</td>
                            </tr>
                            <asp:Repeater ID="cRptOrders" runat="server" OnItemDataBound="OnOrdersItemBound">
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:HiddenField ID="cOrderId" runat="server" />
                                            <asp:Label ID="cLbOrderNumber" runat="server" />

                                        </td>
                                        <td>
                                            <asp:Label ID="cLblOrderDate" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Label ID="cLblOrderAmount" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Label ID="cLblOrderDescription" runat="server" />
                                        </td>
                                        <td align="center">
                                            <%--<asp:LinkButton ID="cBtnEditOrder" runat="server" OnCommand="OnEditCustomer" />--%>
                                            <asp:LinkButton ID="cBtnDeleteOrder" runat="server" OnCommand="OnDeleteCustomer" />
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="cBtnAddCustomer" runat="server" Text="Add new customer" OnClick="cBtnAddCustomer_Click" />
                    </td>
                    <td>

                        <asp:Button ID="cBtnOrder" runat="server" Text="Add new order" OnClick="cBtnOrder_Click" />
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
